package com.lgkj.ui.userinfo;

import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.lgkj.R;
import com.lgkj.ui.BaseActivity;
import com.lgkj.utils.CommonConstant;
import com.lgkj.utils.HttpUtils;

import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Administrator on 2018/8/22 0022.
 * 创客
 */

public class IdentityChuangKeActivity extends BaseActivity {
    @BindView(R.id.tv_identity)
    TextView tvIdentity;
    @BindView(R.id.tv_name)
    EditText tvName;
    @BindView(R.id.tv_province)
    TextView tvProvince;
    @BindView(R.id.tv_city)
    TextView tvCity;
    @BindView(R.id.tv_shop_name)
    EditText tvShopName;
    @BindView(R.id.et_phone)
    EditText etPhone;
    @BindView(R.id.et_card_id)
    EditText etCardId;
    @BindView(R.id.et_card_back_name)
    EditText etCardBackName;
    @BindView(R.id.et_card_name)
    EditText etCardName;
    @BindView(R.id.et_identity_id)
    EditText etIdentityId;
    @BindView(R.id.et_identity_adress)
    EditText etIdentityAdress;
    private String province_id = "0", city_id = "0";

    @Override
    public int getLayoutId() {
        return R.layout.activity_identity_chuangke;
    }

    @Override
    public void initView() {
        setTitle("身份认证");
    }

    @Override
    public void initData() {

    }

    @OnClick({R.id.ll_province, R.id.ll_city, R.id.iv_save})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ll_province:
                break;
            case R.id.ll_city:
                break;
            case R.id.iv_save:
                save();
                break;
        }
    }

    private void save() {
        showDiaLog("正在提交");
        Map<String, String> map = new HashMap<>();
        map.put("access_token", getToken());
        map.put("province_id", province_id);
        map.put("city_id", city_id);
        map.put("barbershop_id", getBarbershopId());
        map.put("name", tvName.getText().toString());
        map.put("phone", etPhone.getText().toString());
        map.put("bank_card", etCardId.getText().toString());
        map.put("bank_address", etCardBackName.getText().toString());
        map.put("bank_name", etCardName.getText().toString());
        map.put("bank_name", etCardId.getText().toString());
        HttpUtils.postHttp(map, CommonConstant.regEntrepreneur, new HttpUtils.HttpCallBack() {
            @Override
            public void successHttp(JSONObject jsonObject, int id) {
                dismissDiaLog();
            }

            @Override
            public void errorHttp(String msg) {
                dismissDiaLog();
            }
        });
    }
}
